<template>
	<view class="orderDetails">	
        <SRV-topbar title="订单详情" :isLeft="true"></SRV-topbar>
		<view class="top">
			<view class="state">
				<view class="right">
					<text>{{info.promotion_id == 5 && info.scrabbleInfo != '' ? info.scrabbleInfo : info.order_status_name}}</text>
					<text class="time" v-if="info.order_status==0">下单后请30分钟内付款，超时订单将自动关闭</text>
				</view>
			    <image v-if="info.order_status==0" src="https://hdsq.aoorange.cn/attachment/xcx/icon/order_bg.png" mode="aspectFill"></image>
				<image v-if="info.order_status==1" src="https://hdsq.aoorange.cn/attachment/xcx/icon/order_bg2.png" mode="aspectFill"></image>
				<image v-if="info.order_status==2||info.order_status==3" src="https://hdsq.aoorange.cn/attachment/xcx/icon/order_bg1.png" mode="aspectFill"></image>
				<image v-if="info.order_status==4 || info.order_status==-4" src="https://hdsq.aoorange.cn/attachment/xcx/icon/order_ok.png" mode="aspectFill"></image>
			</view>
			<view class="address" v-if="info.shipping_type == 1 || info.shipping_type == 2">
				<image src="https://hdsq.aoorange.cn/attachment/xcx/icon/address.png" mode="widthFix"></image>
				<view class="right" @click="showMap()">
					<view class="txt">{{info.shipping_type == 1 ? '收货信息' : '自提店铺'}}</view>
					<view class="txt">
						<text>{{info.address.name}}</text>
						<text @tap.stop="callPhone($event)">{{info.address.mobile}}</text>
					</view>
					<view class="txt1">
						{{info.address.address}}
					</view>
				</view>
			</view>
		</view>
		<view class="goods" style="border-bottom: 1upx solid #ddd;" @click="jump(info.merchantInfo.jumpType, info.merchantInfo.jumpLink)">
			<image :src="info.merchantInfo.logo" mode="aspectFill" style="width: 50upx;height: 50upx;"></image>
			<text>{{info.merchantInfo.name}}</text>
		</view>
        
        <view class="goods" v-for="(item,index2) in info.product_list" :key="index2"  @click="jump(item.jumpType, item.jumpLink)">
            <image :src="item.product_picture" mode="aspectFill" v-if="info.order_type != 4"></image>
            <view class="right" :style="info.order_type == 4 ? 'width:99%;' : ''">
                <view class="right-p">
        			<span v-if="item.reductionName != ''" style="background: rgba(235, 89, 56, 1); color: #ffffff; padding: 0 10rpx;margin-right: 10rpx;">{{item.reductionName}}</span>
        			{{item.product_name}} 
        		</view>
                <view class="size" v-if="info.order_type != 4">
                    <text>{{item.sku_name}}</text>
                    <text>{{item.price}}x{{item.num}}</text>
                </view>
				<view class="size" v-if="info.order_type == 4 && item.remarkList && item.remarkList.length > 0">
				    <view v-for="(content, key) in item.remarkList" style="text-align: right;width: 100%;color: #000;">{{content}}</view>
				</view>
                <view class="num" :style="info.order_type == 4 ? 'text-align: right;margin-top: 20rpx;' : ''">
                    <text>{{item.product_money}}</text>
                    <text v-if="item.use_platform_ratio > 0" style="margin-left: 20rpx;"> * </text>
                    <text v-if="item.use_platform_ratio > 0" style="margin-left: 20rpx;">{{item.use_platform_ratio}}折</text>
                    <text v-if="item.use_platform_ratio > 0" style="margin-left: 20rpx;"> = </text>
                    <text v-if="item.use_platform_ratio > 0" style="margin-left: 20rpx;">{{item.adjust_money}}</text>
                </view>
                
            </view>
        </view>
		<view class="line">
			<text>商品总金额</text>
			<text>￥{{info.moneyList.product_money}}</text>
		</view>
		<view class="line" v-if="info.shipping_type == 1">
			<text>订单运费</text>
			<view class="youFei">
				<view>
					{{info.moneyList.shipping_money > 0 ? '+￥'+info.moneyList.shipping_money : "包邮"}}
				</view>
				<view v-if="info.order_status == 1" style="font-size: 20rpx;margin-top: 10rpx;color: #999999;">
					预计 1 ~ 3 个工作日发货
				</view>
			</view>
		</view>
		<view class="line" v-if="info.columnList && info.columnList.length > 0" v-for="(ci, ck) in info.columnList" @click="jump(ci.jumpType, ci.jumpVal)">
			<text>{{ci.title}}</text>
			<text>{{ci.val}}</text>
		</view>
		<view class="line" v-if="info.newPayInfo.promotion_money > 0">
			<text>减免金额</text>
			<text>-{{'￥'+info.newPayInfo.promotion_money}}</text>
		</view>
		<view class="line" v-if="info.newPayInfo.coupon_money > 0">
			<text>优惠券抵扣</text>
			<text>-{{'￥'+info.newPayInfo.coupon_money}}</text>
		</view>
        <view class="line" v-if="info.newPayInfo.give_coin > 0">
        	<text>业绩值抵扣</text>
        	<text>-{{info.newPayInfo.give_coin}}</text>
        </view>
		<view class="line" v-if="info.newPayInfo.coin_money > 0">
			<text>互动券抵扣</text>
			<text>-{{'￥'+info.newPayInfo.coin_money}}</text>
		</view>
		<view class="line" v-if="info.newPayInfo.user_platform_money > 0">
			<text>品鉴金抵扣</text>
			<text>-{{'￥'+info.newPayInfo.user_platform_money}}</text>
		</view>
        <view class="line" v-if="info.newPayInfo.user_money > 0">
        	<text>商家余额</text>
        	<text>-{{'￥'+info.newPayInfo.user_money}}</text>
        </view>
        <view class="line" v-if="info.newPayInfo.tun_one > 0">
        	<text>囤陈一</text>
        	<text>-{{'￥'+info.newPayInfo.tun_one}}</text>
        </view>
        <view class="line" v-if="info.newPayInfo.tun_three > 0">
        	<text>囤陈三</text>
        	<text>-{{'￥'+info.newPayInfo.tun_three}}</text>
        </view>
		<view class="line" v-if="info.newPayInfo.pay_money > 0">
			<text>{{info.newPayInfo.pay_type_name}}</text>
			<text>{{'￥'+info.newPayInfo.pay_money}}</text>
		</view>
		<view class="line" v-if="info.newPayInfo.wait_pay > 0">
			<text>还需支付</text>
			<text>{{'￥'+info.newPayInfo.wait_pay}}</text>
		</view>
        <view v-if="info.storeReward.isShow == true">
            <view class="line">
                <text>{{info.storeReward.title}}</text>
                <text>{{info.storeReward.val}}</text>
            </view>
            <view style="text-align: right;padding: 20rpx;color: #666;">{{info.storeReward.valTitle}}</view>
        </view>
		<view class="common" v-if="info.promotion_id != 5 && (info.order_type == 1 || info.order_type == 2)">
			<text>买家留言</text>
			<text>{{info.buyer_message}}</text>
		</view>
        <view class="common" v-if="info.promotion_id == 5 && info.friendInfo != ''">
        	<text>拼团好友</text>
        	<text>{{info.friendInfo}}</text>
        </view>
        <!-- <view class="common" v-if="info.promotion_id == 5 && info.scrabbleInfo != ''">
        	<text>{{info.scrabbleInfo}}</text>
        </view> -->
		<view class="info" style="padding: 0;">
			<button class="contact"  open-type="contact">
				<uni-icons type="chatboxes" color="#0095df" size="20" style="margin-right: 10upx;"></uni-icons>
				<text style="font-size: 32rpx;">联系客服</text>
			</button>
		</view>
		<view class="info">
			<text>订单信息：</text>
			<text>订单编号：{{info.order_sn}}</text>
			<text>订单类型：{{info.order_type_name}}</text>
			<text>下单时间：{{info.timeList.create_time}}</text>
			<text v-if="info.timeList.pay_time">支付时间：{{info.timeList.pay_time}}</text>
			<text v-if="info.timeList.consign_time">发货时间：{{info.timeList.consign_time}}</text>
			<text v-if="info.timeList.sign_time">{{info.shipping_type == 1 ? '签收时间：' : '自提时间：'}}{{info.timeList.sign_time}}</text>
			<text v-if="info.timeList.finish_time">完成时间：{{info.timeList.finish_time}}</text>
			<text v-if="info.timeList.cancel_time">取消时间：{{info.timeList.cancel_time}}</text>
		</view>
		<view class="bot" v-if="info.button_list.length > 0">
			<view v-if="info.button_list.length > 0" :class="info.button_list.length == 1 ? 'txt1' : 'txt2'" :style="'height:' + bottomHeight + 'rpx;'">
				<text v-for="(button,index2) in info.button_list" :key="index2" @click="operateFun(button.type)">{{button.name}}</text>
			</view>
		</view>
		<uni-popup ref="popup" type="bottom">
			<view class="pay_type">
				<image @click="close" class="close" :src="'https://hdsq.aoorange.cn/attachment/xcx/icon/close1.png'" mode="aspectFill"></image>
				<view class="title">选择支付方式</view>
				<view class="paypir">
				    <text>应付金额</text>
				    <text>￥{{payMoney}}</text>
				</view>
                <view class="line2" v-if="payInfo.use_merchant_money > 0 " @click="selMerchantMoney()">
                    <view style="display: flex;">
                        <view :class="payData.is_use_merchant_money ?'selRadio':'noRadio'"></view>
                        <text>商家余额（{{payInfo.merchant_money}}）</text>
                    </view>
                    <view style="color: #ff003f;font-size: 38rpx;">-￥{{payInfo.use_merchant_money}}</view>
                    <view class="tipTxt">使用商家余额支付将不能获取商家让利及平台补贴</view>
                </view>
                <view class="line2" v-if="payInfo.sjrl > 0 && payInfo.sjrlInto != ''" @click="selRewardType(1)" :style="payData.is_use_merchant_money ? 'background: #eee;' : ''">
                    <view style="display: flex;">
                        <view :class="payData.reward_type == 1 ?'selRadio':'noRadio'"></view>
                        <text>商家让利</text>
                    </view>
                    <view style="color: #ff003f;font-size: 38rpx;">-{{payInfo.sjrlInto}}</view>
                </view>
                <view class="line2" v-if="payInfo.ptbtInfo != ''" @click="selRewardType(2)" :style="payData.is_use_merchant_money ? 'background: #eee;' : ''">
                    <view style="display: flex;">
                        <view :class="payData.reward_type == 2 ?'selRadio':'noRadio'"></view>
                        <text>平台补贴</text>
                    </view>
                    <view style="color: #ff003f;font-size: 38rpx;">{{payInfo.ptbtInfo}}</view>
                </view>
				<view class="line2" v-if="payInfo.use_judge > 0 && isSelPlatformType" @click="setUseOther(3)">
				    <text>品鉴金{{payInfo.use_judge}}抵扣金额￥{{payInfo.use_judge}}</text>
				    <view :class="payData.is_use_judge == 1 ?'check':'nocheck'"></view>
				</view>
				<view class="line2" v-if="payInfo.use_hdq > 0 && isSelPlatformType" @click="setUseOther(1)">
				    <text>互动券{{payInfo.use_hdq}}抵扣金额￥{{payInfo.use_hdq}}</text>
				    <view :class="payData.is_use_hdq == 1 ?'check':'nocheck'"></view>
				</view>
                <view class="line2" v-if="payInfo.use_three > 0 && isSelPlatformType" @click="setUseOther(5)">
                	<text>平台囤陈三{{payInfo.use_three}}抵扣金额￥{{payInfo.use_three}}</text>
                	<view :class="payData.is_use_three == 1 ?'check':'nocheck'"></view>
                </view>
                <view class="line2" v-if="payInfo.use_one > 0 && isSelPlatformType" @click="setUseOther(7)">
                	<text>平台囤陈一{{payInfo.use_one}}抵扣金额￥{{payInfo.use_one}}</text>
                	<view :class="payData.is_use_one == 1 ?'check':'nocheck'"></view>
                </view>
				<view class="line2" v-if="payInfo.use_merchant_one > 0 && isSelPlatformType" @click="setUseOther(9)">
					<text>商家囤陈一{{payInfo.use_merchant_one}}抵扣金额￥{{payInfo.use_merchant_one}}</text>
					<view :class="payData.is_use_merchant_one == 1 ?'check':'nocheck'"></view>
				</view>
				<view class="line2" v-if="payMoney > 0" @click="selPayType(5)">
				    <text>余额支付 - 当前余额：{{payInfo.user_money}}</text>
				    <view :class="payData.payment_type == 5 ?'sel':'nosel'"
				        v-if="Number(payInfo.user_money) >= Number(payMoney)"></view>
				    <text v-else @click="jump('online_recharge')">余额不足</text>
				</view>
				<view class="line2" v-if="payMoney > 0" @click="selPayType(1)">
				    <text>在线微信支付</text>
				    <view :class="payData.payment_type == 1 ?'sel':'nosel'"></view>
				</view>
				<view :style="'height:' + bottomHeight + 'rpx;'" class="pay_bot" @click="subPay()">确认支付</view>
			</view>
		</uni-popup>
		
		<uni-popup ref="pickupCode">
		    <view class="show pickupCode-box">
		        <view class="title">提货码</view>
		        <image class="img" :src="pickupItem.imgUrl"></image>
		        <view class="pickupCode-t">{{pickupItem.code}}</view>
		        <view class="btn" @click="close()">
		            <text>确认</text>
		        </view>
		    </view>
		</uni-popup>
	</view>
</template>

<script>
	var _self;
	import serve from '../../static/request.js';
	import storage from '../../static/appkey.js';
	import common from '../../static/jump.js';
    import commonPay from '../../static/commonPay.js';
    import uniQrcode from '../../static/wxqrcode.js';
	export default {
		data() {
			return {
				id : 0,
				info : {
					id: 0,
					merchantInfo: {id: 0, name: '', logo : '', jumpType: '', jumpLink: ''},
					order_sn: '',
					order_status: 0,
					order_status_name: '',
					pay_status: 0,
					pay_type: 0,
					pay_type_name: '',
					order_type: 0,
					order_type_name: '',
					shipping_type: 0,
					pickup_code: '',
					product_count: '',
					total_money: '',
					moneyList: {product_money: 0,shipping_money: 0,reduction_money:0,coupon_money:0,hdq_money:0,judge_money:0,pay_money:0},
					payData: {},
					timeList: {create_time: false,pay_time:false,consign_time: false,sign_time:false,finish_time:false,cancel_time:false},
					address: {name: '', mobile: '', address: '', latitude: '', longitude: ''},
					buyer_message: '',
					product_list: [],
					button_list: []
				},
                payData: {
                    appkey: uni.getStorageSync('appkey'),
                    'access-token': uni.getStorageSync('access-token'),
                    pay_type: '',
                    pay_id: 0,
                    is_use_hdq: 0,
                    is_use_judge: 0,
                    is_use_one: 0,
                    is_use_three: 0,
                    is_use_merchant_money: 0,
					is_use_merchant_one: 0,
                    payment_type: 1,
                    reward_type: 0, 
                    jumpFile: '',
                },
                isSelPlatformType: true,
                payMoney: 0,
                payInfo: {},
                pickupItem: {
                    imgUrl: '',
                    code: ''
                },
				bottomHeight: 110,
			}
		},
		methods: {
			callbackFun() {
				this.close();
				this.getInfo();
			},
			getInfo() {
				uni.showLoading({
					title: '加载中···',
					mask: true
				});
				serve.request({
					url: '/member/order/view',
					data: {
						appkey: uni.getStorageSync('appkey'),
						'access-token': uni.getStorageSync('access-token'),
						id: _self.id
					},
					v: '/v3'
				}).then(res => {
					uni.hideLoading();
					if(res.code != 200) {
						uni.showToast({
							title:res.message,
							icon: 'none',
							success() {
								setTimeout(function () {
									common.jump('store_order_list')
								}, 2000) 
							}
						});
					}
					_self.info = res.data;
				});
			},
			numFilter (value) {
				let tempVal = parseFloat(value).toFixed(3);
				let realVal = tempVal.substring(0, tempVal.length - 1);
				return realVal;
			},
			showMap() {
				if(_self.info.shipping_type != 2){
					return ;
				}
				_self.isShow = false;
				uni.openLocation({
				    latitude: Number(_self.info.address.latitude),
				    longitude: Number(_self.info.address.longitude),
				    success: function (res) {
				        console.log(res);
				    }
				});
			},
			callPhone(e) {
				e.preventDefault();
				if(_self.info.shipping_type != 2){
					return ;
				}
				uni.makePhoneCall({
				    phoneNumber: _self.info.address.mobile
				});
			},
			operateFun(operateType) {
			    let operateItem = _self.info;
			    if (operateType == 'order_cancel') {
			        uni.showModal({
			            title: '提示',
			            content: '您确定取消该订单吗',
			            success: function(res) {
			                if (res.confirm) {
			                    serve.request({
			                        url: '/member/order/cancel',
			                        data: {
			                            appkey: uni.getStorageSync('appkey'),
			                            'access-token': uni.getStorageSync('access-token'),
			                            id: operateItem.id,
			                        },
			                        v: '/v3'
			                    }).then(res => {
			                        uni.showToast({
			                            title: res.message,
			                            icon: 'none'
			                        });
			                        if (res.code == 200) {
			                            _self.getInfo();
										_self.$forceUpdate();
			                        }
			                    });
			                }
			            }
			        });
			        return;
			    } else if (operateType == 'order_pay') {
			        _self.startPay(operateItem);
			    } else if (operateType == 'tip_delivery') {
			        serve.request({
			            url: '/member/order/tip-delivery',
			            data: {
			                appkey: uni.getStorageSync('appkey'),
			                'access-token': uni.getStorageSync('access-token'),
			                id: operateItem.id,
			            },
			            v: '/v3'
			        }).then(res => {
			            uni.showToast({
			                title: res.message,
			                icon: 'none'
			            });
						if (res.code == 200) {
							_self.info.button_list = [];
							_self.$forceUpdate();
						}
			        });
			    } else if (operateType == 'shop_express') {
				
			    } else if (operateType == 'task_delivery') {
			        uni.showModal({
			            title: '提示',
			            content: '您确定该订单已确定收货吗',
			            success: function(res) {
			                if (res.confirm) {
			                    serve.request({
			                        url: '/member/order/take-delivery',
			                        data: {
			                            appkey: uni.getStorageSync('appkey'),
			                            'access-token': uni.getStorageSync('access-token'),
			                            id: operateItem.id,
			                        },
			                        v: '/v3'
			                    }).then(res => {
			                        uni.showToast({
			                            title: res.message,
			                            icon: 'none'
			                        });
			                        if (res.code == 200) {
			                            _self.getInfo();
										_self.$forceUpdate();
			                        }
			                    });
			                }
			            }
			        });
			        return;
			    } else if (operateType == 'show_pickup') {
			        _self.pickupItem.code = operateItem.pickup_code;
			        _self.pickupItem.imgUrl = uniQrcode.createQrCodeImg(operateItem.pickup_code, {
			            size: parseInt(100) //二维码大小  
			        });
			        _self.$refs.pickupCode.open();
			        return;
			    } else if (operateType == 'sub_pickup') {
					uni.showModal({
					    title: '提示',
					    content: '您确定该订单已确认自提吗',
					    success: function(res) {
					        if (res.confirm) {
					            serve.request({
					                url: '/member/order/sub-pickup',
					                data: {
					                    appkey: uni.getStorageSync('appkey'),
					                    'access-token': uni.getStorageSync('access-token'),
					                    id: operateItem.id,
					                },
					                v: '/v3'
					            }).then(res => {
					                uni.showToast({
					                    title: res.message,
					                    icon: 'none'
					                });
					                if (res.code == 200) {
					                    _self.getInfo();
										_self.$forceUpdate();
					                }
					            });
					        }
					    }
					});
					return;
				}
			},
			startPay(item) {
			    serve.request({
			        url: '/member/order/pay-info',
			        data: {
			            appkey: uni.getStorageSync('appkey'),
			            'access-token': uni.getStorageSync('access-token'),
                        id: item.id
			        },
			        v: '/v3'
			    }).then(res => {
			        _self.payInfo = res.data;
                    _self.payMoney = JSON.parse(JSON.stringify(_self.payInfo.waitPayMoney));
                    _self.payData.pay_type = _self.payInfo.pay_type;
                    _self.payData.pay_id = _self.payInfo.pay_id;
                    _self.payData.is_use_merchant_money = 0;
                    _self.payData.reward_type = 0;
					if(_self.payInfo.sjrlInto != '') {
						_self.payData.reward_type = 1;
					}
					if(_self.payInfo.ptbtInfo != '') {
						_self.payData.reward_type = 2;
					}
                    _self.payData.is_use_hdq = 0;
                    _self.payData.is_use_judge = 0;
                    _self.payData.is_use_one = 0;
                    _self.payData.is_use_three = 0;
					_self.payData.is_use_merchant_money = 0;
					_self.payData.is_use_merchant_one = 0;
                    _self.$refs.popup.open();
			    });
			},
            selMerchantMoney() {
                _self.payMoney = JSON.parse(JSON.stringify(_self.payInfo.waitPayMoney));
                _self.payData.is_use_merchant_money = _self.payData.is_use_merchant_money == 1 ? 0 : 1;
				_self.isSelPlatformType = true;
                if(_self.payData.is_use_merchant_money) {
                    _self.payMoney = _self.numFilter(Number(_self.payMoney) - Number(_self.payInfo.use_merchant_money));
					_self.isSelPlatformType = _self.payMoney > 0;
					if(_self.payMoney <= 0 && _self.payData.payment_type != 5) {
						_self.payData.payment_type = 5;
					}
                    return ;
                }
                if(_self.payInfo.sjrlInto != '') {
                    _self.payData.reward_type = 1;
                }
                if(_self.payInfo.ptbtInfo != '') {
                    _self.payData.reward_type = 2;
                }
            },
            setUseOther(type) {
            	if (type == 1) {
            		_self.payData.is_use_hdq = _self.payData.is_use_hdq == 1 ? 0 : 1;
            	} 
                if (type == 3){
            		_self.payData.is_use_judge = _self.payData.is_use_judge ? 0 : 1;
            	}
                if (type == 5){
                	_self.payData.is_use_three = _self.payData.is_use_three ? 0 : 1;
                }
                if (type == 7){
                	_self.payData.is_use_one = _self.payData.is_use_one ? 0 : 1;
					_self.payData.is_use_merchant_one = 0;
                }
				if (type == 9){
					_self.payData.is_use_one = 0;
					_self.payData.is_use_merchant_one = _self.payData.is_use_merchant_one == 1 ? 0 : 1;
				}
                _self.payMoney = JSON.parse(JSON.stringify(_self.payInfo.waitPayMoney));
				console.log("1、"+_self.payMoney);
				if(_self.payData.is_use_merchant_money == 1) {
					_self.payMoney = _self.numFilter(Number(_self.payMoney) - Number(_self.payInfo.use_merchant_money));
				}
				console.log("2、"+_self.payMoney);
                if(_self.payData.is_use_hdq == 1) {
                    _self.payMoney = _self.numFilter(Number(_self.payMoney) - Number(_self.payInfo.use_hdq));
                } 
                if(_self.payData.is_use_judge == 1) {
                    _self.payMoney = _self.numFilter(Number(_self.payMoney) - Number(_self.payInfo.use_judge));
                } 
                if(_self.payData.is_use_three == 1) {
                    _self.payMoney = _self.numFilter(Number(_self.payMoney) - Number(_self.payInfo.use_three));
                } 
                if(_self.payData.is_use_one == 1) {
                    _self.payMoney = _self.numFilter(Number(_self.payMoney) - Number(_self.payInfo.use_one));
                }
				if(_self.payData.is_use_merchant_one == 1) {
					console.log("3、"+_self.payMoney);
				    _self.payMoney = _self.numFilter(Number(_self.payMoney) - Number(_self.payInfo.use_merchant_one));
					console.log("4、"+_self.payMoney);
				}
				// _self.payData.payment_type = 1;
				if(_self.payMoney <= 0) {
					_self.payMoney = 0.00;
				    _self.payData.payment_type = _self.payData.payment_type != 5 ? 5 : _self.payData.payment_type;
				}
            },
            selRewardType(type) {
                if(_self.payData.is_use_merchant_money) {
                    _self.payData.reward_type = 0;
                    return ;
                }
                _self.payData.reward_type = type;
                if(_self.payData.reward_type == 1) {
                    _self.payMoney = _self.numFilter(Number(_self.payMoney) - Number(_self.payInfo.sjrl));
                } else {
                    _self.payMoney = _self.numFilter(Number(_self.payMoney) + Number(_self.payInfo.sjrl));
                }
            },
			selPayType(payType) {
				if (payType == 5 && Number(_self.payInfo.user_money) < Number(_self.payMoney)) {
					return;
				}
				_self.payData.payment_type = payType;
			},
			close() {
			    _self.$refs.popup.close();
			    _self.$refs.pickupCode.close();
			},
			subPay() {
			    commonPay.payFun(_self.payData, _self, 2);
			},
			jump(jump_type, jump_link){
				common.jump(jump_type, jump_link);
			}
		},
		onLoad(options) {
			_self = this;
			if(uni.getSystemInfoSync().safeAreaInsets.top > 20){
				_self.bottomHeight = 150;
			}
			_self.id=options.id || 0;
			if(_self.id == 0) {
				uni.showToast({
					title: "错误的访问方式",
					icon: 'none',
					success() {
						setTimeout(function () {
							common.jump('return_one')
						}, 2000) 
					}
				});
			}
		},
		onShow() {
			if(_self.isShow == false){
				return ;
			}
			_self.getInfo();
		},
		onPullDownRefresh() {
			uni.showLoading({
				title: '加载中···',
				mask: true
			});
			_self.getInfo();
		}
	}
</script>

<style scoped lang="scss">
	@media only screen and (device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) {
		    .orderDetails {
		        padding-bottom: 124upx !important;
				.bot{
					 padding-bottom: 12px !important;
					 
				}
		    }
		}
	.orderDetails {
		padding-bottom: 150upx;

		.top {
			position: relative;
			border-bottom: 16upx rgba(251, 251, 253, 1) solid;

			.state {
				position: relative;
				box-sizing: border-box;
				// padding: 58upx 48upx;
				width: 100%;
				height: 250upx;
				// background: #F5F5FE;
				display: flex;
				justify-content: space-between;
				align-items: center;
				position: relative;
				font-size: 48upx;
				font-family: YouSheBiaoTiHei;
				font-weight: bold;
				color: #333333;
				image {
					position: absolute;
					width: 100%;
					height: 250upx;
					z-index: 0;
				}
				.right{
					position: relative;
					z-index: 10;
					display: flex;
					flex-direction: column;
					padding-left: 30upx;
					// width: 280upx;
					.time {
						// position: absolute;
						// bottom: 18upx;
						color: #333333;
						font-size: 20upx;
						font-style:normal;
						font-weight: 400;
						margin-top: 14upx;
					}
				}

				
			}
            .line1{
				box-sizing: border-box;
				display: flex;
				padding: 0upx 30upx;
				height: 130upx;
				align-items: center;
				justify-content: space-between;
				border-bottom: 1upx rgba(53,63,110,0.06) solid;
				.left{
					display: flex;
					align-items: center;
					font-size: 28upx;
					color: #666666;
					image{
						width:40upx;
						height:29upx;
						margin-right: 13upx;
					}
				}
				.right{
					color: #EB5938;
					font-size: 28upx;
					font-weight: bold;
				}
			}

			.img {
				position: absolute;
				bottom: 0;
				height: 10upx;
				width: 100%;
			}
		}

		.goods {
			box-sizing: border-box;
			display: flex;
			align-items: center;
			padding: 40upx 30upx;
			border-bottom: 1upx rgba(235, 236, 240, 1) solid;

			image {
				width: 170upx;
				height: 170upx;
				margin-right: 20upx;
			}

			.right {
				position: relative;
				width: 503upx;
				display: flex;
				// justify-content: center;
				flex-direction: column;
				font-size: 32upx;
				.right-p{
					-webkit-line-clamp: 2;
					overflow: hidden;
					word-break: break-all;
					text-overflow: ellipsis; 
					display: -webkit-box; 
					-webkit-box-orient: vertical; 
				}
				.operate {
					position: absolute;
					right: 0upx;
					bottom: 0upx;
					width: 130upx;
					height: 48upx;
					border: 1px solid #999999;
					border-radius: 24upx;
					text-align: center;
					font-size: 24upx;
					line-height: 48upx;
					font-weight: bold;
					color: #999999;
				}

				.size {
					display: flex;
					justify-content: space-between;
					padding: 20upx 0upx;
					color: #999999;
					font-size: 24upx;
					align-items: center;
				}

				text:first-child {
					overflow: hidden;
					text-overflow: ellipsis;
					white-space: nowrap;
				}

				.num {
					font-size: 28upx;
					font-weight: bold;
					color: #FF5F60;
				}
				.num1{
					font-size:20upx;
					font-weight:400;
					text-decoration:line-through;
					color: #CCCCCC;
				}
			}
		}

		.line {
			box-sizing: border-box;
			padding: 37upx 30upx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			font-size: 28upx;
			// font-weight: bold;
			color: #666666;
			border-bottom: 1upx rgba(235, 236, 240, 1) solid;

			text:last-child {
				color: #FF5F60;
				font-size: 32upx;
			}
			.youFei{
				display: flex;
				flex-direction: column;
				align-items: flex-end;
				color: #FF5F60;
				font-size: 32upx;
			}

			;
		}

		.pic {
			box-sizing: border-box;
			padding: 37upx 30upx;
			display: flex;
			justify-content: flex-end;
			align-items: flex-end;
			font-size: 28upx;
			color: #999999;
			border-bottom: 1upx rgba(235, 236, 240, 1) solid;

			text:last-child {
				color: #FF5F60;
				font-size: 32upx;
				font-weight: bold;
			}

			;
		}

		.common {
			box-sizing: border-box;
			padding: 37upx 30upx;
			display: flex;
			justify-content: space-between;
			flex-wrap: wrap;
			align-items: flex-start;
			// font-weight: bold;
			font-size: 28upx;
			color: #666666;
			border-bottom: 16upx rgba(251, 251, 253, 1) solid;

			text:last-child {
				max-width: 540upx;
			}

			;
		}
		.contact{
			//background: white;
			height: 100upx;
			width: 400upx;
			box-sizing: border-box;
			// display: inline;
			font-size: 15upx;
			//font-weight: 400;
			border-radius: 50upx;
			//border: 2upx #cccccc solid;
			background-color: #FFFFFF;
			text{
				color: #666666;
			}
		}
		.contact::after{
			content: '';
			border: none;
		}
		.info {
			display: flex;
			flex-direction: column;
			padding: 10upx 30upx;
			font-size: 28upx;
			color: #666666;
			border-bottom: 20rpx #fbfbfd solid;

			text:first-child {
				font-weight: bold;
				margin-top: 0upx;
				color: #333333;
			}

			text {
				font-weight: 400;
				margin-top: 20upx;
			}
			.pickupView{
				display: flex;
				align-items: center;
				padding: 32upx 27upx 32upx 0upx;
				box-sizing: border-box;
				text-align: center;
				view {
					width: 33.3%;
					font-size: 32upx;
					position: relative;
					text-align: center;
				}
			}
		}

		.bot {
			position: fixed;
			width: 100%;
			height: 100upx;
			bottom: 0upx;
			border-top: 1upx #EBECF0 solid;
            padding-bottom: env(safe-area-inset-bottom);
			background-color: #FFFFFF;
			.txt1 {
				box-shadow: 0px 1upx 0px 0px rgba(235, 236, 240, 1);
				width: 100%;
				height: 100%;
				background: #FFBF0A;
				color: #FFFFFF;
				font-size: 28upx;
				text-align: center;
				line-height: 100upx;
				display: flex;
				text {
					background: #FFBF0A;
					color: #FFFFFF;
					height: 100upx;
					line-height: 100upx;
					width: 100%;
				}
			}

			.txt2 {
				box-shadow: 0px 1upx 0px 0px rgba(235, 236, 240, 1);
				display: flex;
				width: 100%;
				height: 100%;

				text {
					height: 100upx;
					line-height: 100upx;
					text-align: center;
					width: 50%;
					font-size: 28upx;
					background: #FFFFFF;
					color: #666666;
				}

				text:last-child {
					background: #FFBF0A;
					color: #FFFFFF;
				}
			}
		}
		.pay_type{
			position: relative;
			width: 100%;
			background: #FFFFFF;
			padding-bottom: 140upx;
			.close{
				position: absolute;
				width:23upx;
				height:23upx;
				right: 40upx;
				top: 45upx;
			}
			.title{
				width: 100%;
				text-align: center;
				height: 100upx;
				line-height: 100upx;
				font-size: 36upx;
				border-bottom: 1upx #EBECF0 solid;
			}
			.paypir{
				display: flex;
				justify-content: center;
				flex-direction: column;
				align-items: center;
				padding: 50upx 0upx 20upx;
				font-size: 28upx;
				color: #FF5F60;
				text:last-child{
					color: #FF5F60;
					font-size: 40upx;
					font-weight: bold;
					margin-top: 10upx;
				}
			}
			.line2{
				width: 100%;
				box-sizing: border-box;
				padding: 36upx;
				display: flex;
                flex-wrap: wrap;
				justify-content: space-between;
				font-size: 28upx;
				color: #333333;
				border-bottom: 1upx #EBECF0 solid;
				.txt{
					color: #999999;
				}
				.nosel {
					width: 36upx;
					height: 36upx;
					border: 1upx solid rgba(60, 72, 104, 1);
					border-radius: 50%;
				}
				.sel {
					background-image: url(../../static/img/check.png);
					background-repeat: no-repeat;
					width: 40upx;
					height: 40upx;
					background-size: 100%;
				}
				.nocheck {
					width: 36upx;
					height: 36upx;
					border: 1upx solid rgba(60, 72, 104, 1);
					border-radius: 20%;
				}
				.check {
					background: url(../../static/img/checkbox_check.png);
					background-repeat: no-repeat;
					width: 40upx;
					height: 40upx;
					background-size: 100%;
				}
			}
			.pay_bot {
			  width: 100%;
			  position: fixed;
			  left: 0;
			  bottom: 0;
			  height: 100upx;
			  background: #FFBC00;
			  color: #fff;
			  font-size: 32upx;
			  line-height: 100upx;
			  text-align: center;
			  border-radius: 0;
			  &::after{
				  border: none;
			  }
			}
		}
		.pickupCode-box{
			width: 80vw;
			background: #fff;
			border-radius: 8rpx;
			.title{
				width: 100%;
				    text-align: center;
				    color: #333333;
				    height: 100rpx;
				    line-height: 100rpx;
				    font-size: 36rpx;
			}
			.img{
				width: 480rpx;
				    height: 48rrpx;
				    position: relative;
				    left: 50%;
				    margin-left: -240rpx
			}
			.pickupCode-t{
				    width: 100%;
				    text-align: center;
				    height: 60rpx;
				    line-height: 60rpx;
				    letter-spacing: 8rpx;
				    font-size: 40rpx;
			}
			.btn{
				    width: 100%;
				    height: 100rpx;
				    text-align: center;
				    line-height: 100rpx;
				    font-size: 32rpx;
				    color: #333333;
			}
		}
        .noRadio {
            width: 36upx;
            height: 36upx;
            border: 1upx solid rgba(60, 72, 104, 1);
            border-radius: 50%;
            margin-right: 20rpx;
        }
        
        .selRadio {
            background-image: url(../../static/img/check.png);
            background-repeat: no-repeat;
            width: 40upx;
            height: 40upx;
            background-size: 100%;
            margin-right: 20rpx;
        }
        
        .tipTxt {
            width: 100%;
            padding-top: 10rpx;
            padding-left: 55rpx;
        }
		.address {
			display: flex;
			position: relative;
			padding: 30rpx 20rpx 30rpx 70rpx;
			font-size: 28upx;
			align-items: center;
			color: #666666;

			image {
				position: absolute;
				left: 30upx;
				width: 31upx;
				height: 37upx;
				top: 120upx;
			}
			
			.txt {
				display: flex;
				justify-content: space-between;
				padding-bottom: 28upx;
			}
			.txt:first-child {
				font-size: 42rpx;
			}
			.jt {
				position: absolute;
				right: 30upx;
				top: 105upx;
				content: '';
				border: 1upx solid rgba(57, 72, 107, 0.5);
				border-width: 0 3upx 3upx 0;
				padding: 6upx;
				transform: rotate(-45deg);
				-webkit-transform: rotate(-45deg);
			}
		}
	}
</style>
